import request from '@/utils/request'

// 查询服务套餐爱列表
export function listProboxServiceCard(query) {
  return request({
    url: '/prod-api/proBoxService/card/list',
    method: 'get',
    params: query
  })
}




// 查询服务套餐详细
export function getCard(itemId) {
  return request({
    url: '/prod-api/proBoxService/card/getView/' + itemId,
    method: 'get'
  })
}

// 新增服务套餐
export function addCard(data) {
  return request({
    url: '/prod-api/proBoxService/card/add',
    method: 'post',
    data: data
  })
}

// 修改服务套餐
export function editCard(data) {
  return request({
    url: '/prod-api/proBoxService/card/edit',
    method: 'put',
    data: data
  })
}

// 删除服务套餐
export function delCard(itemIds) {
  return request({
    url: '/prod-api/proBoxService/card/' + itemIds,
    method: 'delete'
  })
}

// 删除sku
export function delSku(skuId) {
  return request({
    url: '/prod-api/proBoxService/card/delsku/' + skuId,
    method: 'delete'
  })
}

// 修改服务套餐状态
export function updateStatus(cardId,auditStatus) {
  let data = {cardId,auditStatus}
  return request({
    url: '/prod-api/proBoxService/card/updateStatus',
    method: 'put',
    data: data
  })
}


export function updateShow(cardId,isShow) {
  let data = {cardId,isShow}
  return request({
    url: '/prod-api/proBoxService/card/updateShow',
    method: 'put',
    data: data
  })
}

// 修改服务套餐是否推荐
export function updateRecommend(cardId,isRecommend) {
  let data = {cardId
  ,isRecommend}
  return request({
    url: '/prod-api/proBoxService/card/updateRecommend',
    method: 'put',
    data: data
  })
}


// 获取服务套餐相关的设备信息
export function listDeviceByCardId(itemId) {
  return request({
    url: '/prod-api/proBoxService/card/listDeviceByCardId/' + itemId,
    method: 'get'
  })
}

// 获取服务套餐相关的门店信息
export function listStoreByCardId(itemId) {
  return request({
    url: '/prod-api/proBoxService/card/listStoreByCardId/' + itemId,
    method: 'get'
  })
}


// 获取服务套餐相关的叠加信息
export function listComposeByCardId(itemId) {
  return request({
    url: '/prod-api/proBoxService/card/listComposeByCardId/' + itemId,
    method: 'get'
  })
}

// 投放门店
export function isSaveByList(data,id) {
  return request({
    url: '/prod-api/proBoxService/card/isSaveByList/'+id,
    method: 'post',
    data: data
  })
}


// 投放设备
export function isSaveDeviceByList(data,id) {
  return request({
    url: '/prod-api/proBoxService/card/isSaveDeviceByList/'+id,
    method: 'post',
    data: data
  })
}

// 叠加项目
export function addOrUpdateCompose(data,id) {
  return request({
    url: '/prod-api/proBoxService/card/addOrUpdateCompose/'+id,
    method: 'post',
    data: data
  })
}

// 投放设备的查询
export function listByCardId(query) {
  return request({
    url: '/prod-api/proBoxService/card/listByCardId',
    method: 'get',
    params: query
  })
}

//叠叠乐查询
export function getDdl() {
  return request({
    url: '/prod-api/proBoxService/card/getDdl',
    method: 'get'
  })
}

// 修改叠叠乐
export function editDdlEdit(data) {
  return request({
    url: '/prod-api/proBoxService/card/ddlEdit',
    method: 'put',
    data: data
  })
}

// 删除叠叠乐
export function delDdl(itemIds) {
  return request({
    url: '/prod-api/proBoxService/card/ddlDel/' + itemIds,
    method: 'delete'
  })
}